package deviceModel

import (
	"gitee.com/fierce_wolf/go-fox-edge-common/commRedisService"
	"gitee.com/fierce_wolf/go-fox-edge-common/edgeEntity"
)

var (
	contex *deviceModelContext
	notify *deviceModelNotify
)

func init() {
	contex = &deviceModelContext{}
	notify = &deviceModelNotify{}
}

func InitLoadEntity() error {
	redisService := commRedisService.IRedisManager.GetRedisService(edgeEntity.Type.DeviceModelEntity.Type())
	redisService.SetTypeNotify(notify)

	contex.dataMap = make(map[string]interface{})
	return contex.initLoadEntity()
}

func GetDeviceModels(modelName string) map[string]interface{} {
	return contex.getDeviceModels(modelName)
}
